package com.datang.petstore.controller;
/*
 * @auther 顶风少年
 * @mail dfsn19970313@foxmail.com
 * @date 2019-11-07 21:36
 * @notify 微博评论点赞api
 * @version 1.0
 */

import com.datang.petstore.aop.ForbidAnnotation;
import com.datang.petstore.entity.MicroblogCommentLikeRecord;
import com.datang.petstore.model.MicroblogCommentLikeRecordRequest;
import com.datang.petstore.resultpage.Result;
import com.datang.petstore.service.MicroblogCommentLikeRecordService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MicroblogCommentLikeRecordController {

    @Autowired
    private MicroblogCommentLikeRecordService microblogCommentLikeRecordService;

    @PostMapping(value = "microblog/comment/like")
    @ForbidAnnotation
    public Result addMicroblogCommentLikeRecord(@RequestBody MicroblogCommentLikeRecordRequest microblogCommentLikeRecordRequest) {
        MicroblogCommentLikeRecord microblogCommentLikeRecord = new MicroblogCommentLikeRecord();
        BeanUtils.copyProperties(microblogCommentLikeRecordRequest, microblogCommentLikeRecord);
        microblogCommentLikeRecordService.addMicroblogCommentLikeRecord(microblogCommentLikeRecord);
        return Result.ok();
    }
}
